package com.ysh.spring.exp.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.Random;

/**
 * 袁胜虎 on 2022/8/30 21:58
 */
@RestController
@RequestMapping("/test")
public class TestController {
    @RequestMapping("/test1")
    public String test1() {
        if (new Random().nextBoolean()) {
            int i = 1 / 0;
        }
        return "test1success";

    }

    @RequestMapping("/test2")
    public String test2() {
        if (new Random().nextBoolean()) {
            String s = null;
            s.toString();
        }
        return "test2success";

    }


    @RequestMapping("/test3")
    public String test3() {
        if (new Random().nextBoolean()) {
            ArrayList<Object> list = new ArrayList<>();
            list.get(10);
        }
        return "test3success";
    }


    @RequestMapping("/test4")
    public String test4() {
        if (new Random().nextBoolean()) {
            ArrayList<Object> list = new ArrayList<>();
            list.get(10);
        }
        return "test4success";
    }
}
